/*
 *    Copyright (c) 2018-2025, boss All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the boss developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: boss
 */

package com.hopes.bizz.enforcement.hid.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.hopes.bizz.enforcement.common.constant.enums.EnforcementSysDictEnum;
import com.hopes.boss.admin.api.resolver.DictResolver;
import com.hopes.boss.common.entity.BaseLogicEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;

/**
 * 法律法规库
 *
 * @author pig
 * @date 2024-01-18 11:08:24
 */
@Data
@TableName("base_law_stash")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "法律法规库")
public class BaseLawStashEntity extends BaseLogicEntity {

    private static final long serialVersionUID = 1L;


    /**
     * 标识
     */
    @TableId(type = IdType.ASSIGN_ID)
    @Schema(description = "标识")
    private Long id;

    /**
     * 文件类别
     */
    @Schema(description = "文件类别")
    private String fileType;

    /**
     * 文件名称
     */
    @Schema(description = "文件名称")
    private String fileName;

    /**
     * 文件状态
     */
    @Schema(description = "文件状态")
    private String fileStatus;

    /**
     * 文件编号
     */
    @Schema(description = "文件编号")
    private String fileNumber;

    /**
     * 文件发布部门
     */
    @Schema(description = "文件发布部门")
    private String filePublishDept;

    /**
     * 文件发布日期
     */
    @Schema(description = "文件发布日期")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date filePublishDate;

    /**
     * 备注说明
     */
    @Schema(description = "备注说明")
    private String remark;

    /**
     * 附件
     */
    @Schema(description = "附件")
    private String attachment;

    /**
     * 机构ID
     */
    @Schema(description = "机构ID")
    private Long orgId;

    public String getFileTypeStr() {

        return DictResolver.getItemLabelByValue(EnforcementSysDictEnum.file_type, this.fileType);
    }

    public String getFileStatusStr() {

        return DictResolver.getItemLabelByValue(EnforcementSysDictEnum.file_status, this.fileStatus);
    }

}
